{{partial('public/header')}}

<div class="midder">
<div class="mc">
<h1 id="linkh_tit">
{{seo.title}}
<span><a href="{{url('group/show/'~strGroup['groupid'])}}">&lt;&lt;返回到{{strGroup['groupname']}}</a></span>
</h1>

<div class="mod">

<form method="post" id="remote-link-form" name="lzform" action="{{url('group/topic/parseurl')}}">
	<div style="display:none;"><input type="hidden" name="{{security.getTokenKey()}}" value="{{security.getToken()}}"></div>
    <div class="item">
      <label>链接:</label>
      <div class="item-right">
        <div class="top">
          <input type="text" value="" class="basic-input input-title" size="50" id="link-url" name="url">
            <span class="bn-flat">
              <input type="submit" value="开始抓取" class="suggest-title" id="startParse-t">
            </span>
            <span id="status"></span>
        </div>
      </div>
    </div>
    <div class="item">
      <label>标题:</label>
      <div class="item-right">
        <div class="top">
          <input type="text" value="" class="basic-input" max-length="500" size="50" id="link-title" name="title">
        </div>
        <p class="bottom">
          合适的标题是讨论的起点
        </p>
      </div>
    </div>
    <div class="item link-tags">
      <label>标签:</label>
      <div class="item-right">
		<input  onKeyDown="checkTag(this)" onKeyUp="checkTag(this)"  onBlur="checkTag(this)" type="text" value=""  name="tag" id="tag" tabindex="3" class="basic-input" placeholder="添加标签，多个标签用空格分隔，方便内容被搜索"> <div class="tip"></div>
         
    <div class="site-tags">
    <dl class="tag-items" id="tag-items">
        <dd onClick="tags(this)">新闻</dd>
        <dd onClick="tags(this)">搞笑</dd>
        <dd onClick="tags(this)">八卦</dd>
        <dd onClick="tags(this)">酷炫</dd>
        <dd onClick="tags(this)">科技</dd>
        <dd onClick="tags(this)">吐槽</dd>
        <dd onClick="tags(this)">财经</dd>
        <dd onClick="tags(this)">玩物</dd>
        <dd onClick="tags(this)">时尚</dd>
        <dd onClick="tags(this)">美食</dd>
        <dd onClick="tags(this)">商品</dd>
        <dd onClick="tags(this)">网址</dd>
        <dd onClick="tags(this)">梦想</dd>
        <dd onClick="tags(this)">北京</dd>
        <dd onClick="tags(this)">青年旅舍</dd>        
    </dl>
    </div>   
        
      </div>
    </div>
    <div class="item" style="display:none" id="ImgBar">
      <label>头图:</label>
      <div class="item-right">
        <div class="top">
         	  <img id="leaderImg" src="http://img5.douban.com/view/group_topic/large/public/p19748548.jpg">
        </div>
      </div>
    </div>     
    <div class="item" style="display:none" id="ContentBar">
      <label>内容:</label>
      <div class="item-right">
        <div class="top">
          <textarea tabindex="2"  name="content"  id="preContent" class="basic-content"></textarea>
        </div>
      </div>
    </div>    
    <div class="item-submit">
      <div class="item-right">
        <span class="bn-flat">
          <input type="submit" value="好了，贴之" name="rev_submit" id="post-btn" disabled>
        </span>
        <span class="bn-flat button-cancel">
          <input type="button" value="撤消" class="cancel" onClick="history.go(-1)">
        </span>
      </div>
    </div>
  </form>	
</div>



</div>
</div>
<script>

$(document).ready(function() { 
	$('#startParse').bind('click',function(){
		var posturl = '{{url("group/topic/parseurl")}}';
		var url = 	$('input[name=url]').val();
		if(url=='') return;
		$("#status").html('<img src="'+siteUrl+'static/images/loading.gif" />');
		$.post(posturl,{url:url},function(res){
			$("#status").html('');
			if(res.r==0){
				data = res.data;
				$('#link-title').val(data.title);
				if(data.lead_image_url !=''){
					$('#leaderImg').attr('src',data.lead_image_url);
					$('#ImgBar').show();
				}				
				if(data.content !=''){
					$('#preContent').val(data.content);
					$('#ContentBar').show()
				}				
			}else if(res.r ==1){
				alert(res.html);
			}
		});
	});	
})
</script>